<?php $this->beginPage() ?>

<?php
    use common\collection\Common;
    use common\helpers\PublicFun;
    use backend\config\routeParams;
    $cookies = Yii::$app->request->cookies;
    $cookie = $cookies->get('MytipIdBack')->value;
    $JsonData['MytipId'] = $cookie;
    //左侧导航栏
    $url = routeParams::HttpUrl('ControllerActionGetList');
    $result = PublicFun::PostPackage($JsonData, $url);
    $result = json_decode($result['Body'],true);
    //个人信息
    $url = routeParams::HttpUrl('GetMytipInfo');
    $result1 = PublicFun::PostPackage($JsonData, $url);
    $result1 = json_decode($result1['Body'],true);
    $Info = $result1['Model'];
//    var_dump($Info);
//exit;
//    foreach($result['Models'] as $key => $val){
//        var_dump($val['ActionList']);
//    }
//    exit;
$controllerID = Yii::$app->controller->id;

$actionID = Yii::$app->controller->action->id;
//var_dump($controllerID);
//var_dump($actionID);
//var_dump($controllerID.'/'.$actionID);
//exit;
//if(($controllerID.'/'.$actionID) == 'site/index'){ echo 'active';}
//exit;

?>


<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
        <meta name="author" content="Coderthemes">
        <link rel="shortcut icon" href="img/favicon_1.ico">
        <title>集客多多</title>
        <!-- Bootstrap core CSS -->
        <link href="/modules/css/bootstrap.min.css" rel="stylesheet">
        <link href="/modules/css/bootstrap-reset.css" rel="stylesheet">
        <!--Animation css-->
        <link href="/modules/css/animate.css" rel="stylesheet">
        <!--Icon-fonts css-->
        <link href="/modules/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
        <link href="/modules/assets/ionicon/css/ionicons.min.css" rel="stylesheet" />
        <!--Morris Chart CSS -->
        <link rel="stylesheet" href="/modules/assets/morris/morris.css">
        <!-- sweet alerts -->
        <link href="/modules/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
        <!-- Custom styles for this template -->
        <link href="/modules/css/style.css" rel="stylesheet">
        <link href="/modules/css/helper.css" rel="stylesheet">
        <!-- 自己的css -->
        <link href="/css/wxq.css?v=1.0" rel="stylesheet">
        <link href="/css/dyl.css" rel="stylesheet">
        <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
        <!--[if lt IE 9]>
          <script src="/modules/js/html5shiv.js"></script>
          <script src="/modules/js/respond.min.js"></script>
        <![endif]-->
        <script src="/modules/js/jquery.js"></script>
        <!-- seajs -->
        <script type="text/javascript" src="/modules/assets/layer/layer.min.js" ></script>
        <!-- 表格 -->
        <script src="/modules/js/dataTables/jquery.dataTables.js"></script>
        <script src="/modules/js/dataTables/dataTables.bootstrap.js"></script> 
        <link href="/modules/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="/static/sea.js"></script>
        <script>seajs.config({base:'/static/js/'})</script>
        <script type="text/javascript">
            layer.config({
                extend: 'extend/layer.ext.js'
            });
            var $_GET = (function(){
                var url = window.document.location.href.toString();
                url = url.replace(location.hash, '');
                var u = url.split("?");
                if(typeof(u[1]) == "string"){
                    u = u[1].split("&");
                    var get = {};
                    for(var i in u){
                        var j = u[i].split("=");
                        get[j[0]] = j[1];
                    }
                    return get;
                } else {
                    return {};
                }
            })();
        </script>
        <style>
            .dropdown-backdrop{z-index: 1;}
        </style>

    </head>
    <body>
        <!-- Aside Start-->
        <aside class="left-panel">
            <!-- brand -->
            <div class="logo <?php if(($controllerID.'/'.$actionID) == 'site/index'){ echo 'active';} ?>">
                <a href="/site/index" class="logo-expanded <?php if(($controllerID.'/'.$actionID) == 'site/index'){ echo 'active';} ?>">
                    <!-- <i class="ion-social-buffer"></i> -->
                    <!-- <span class="nav-label">Velonic</span> -->
                    <img class="logoimg" src="/modules/img/slefneed/logo.png" style="margin-right: 10px;">
                </a>
            </div>
            <!-- / brand -->
            <!-- Navbar Start -->
            <nav class="navigation">
                <ul class="list-unstyled">
                    <li class="q-index"><a href="/site/index"><i class="ion-home"></i> <span class="nav-label">首页</span></a></li>

                    <?php 
                        // print_r($result);exit;

                    foreach($result['Models'] as $key => $val){ ?>
                        <li class="has-submenu cate-<?php echo $val['ControllerCode'] ?> <?php if($controllerID ==$val['ControllerCode'] ){echo  'active';} ?> " ><a href="#"><i class="<?php echo $val['LeftIcon'] ?>"></i> <span class="nav-label"><?php echo $val['ControllerName'] ?></span></a>
                            <ul class="list-unstyled">
                                <?php foreach($val['ActionList'] as $k => $v){?>
                                    <li  class="<?php if($actionID == $v['ActionCode']){echo  'active';} ?> d-<?php echo  $v['ActionCode'] ?>" ><a href="/<?php echo $val['ControllerCode'].'/'.$v['ActionCode'] ?>"><?php echo $v['ActionName'] ?></a></li>
                                <?php }  ?>
                            </ul>
                        </li>
                  <?php }  ?>

                </ul>
            </nav>
        </aside>
        <!-- Aside Ends-->
        <section class="content">
            <!-- Header -->
            <header class="top-head container-fluid" style="background:#2f353f">
                <button type="button" class="navbar-toggle pull-left">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <!-- Search -->
                <form role="search" class="navbar-left app-search pull-left hidden-xs" style="width: 25%;">
                  <input type="text" placeholder="Search..." class="form-control" style="outline: none;-webkit-appearance: none;-moz-appearance: none;-o-appearance: none;appearance: none;">
                  <a href=""><i class="fa fa-search"></i></a>
                </form>
                <!-- Left navbar -->
               <!--  <nav class=" navbar-default hidden-xs" role="navigation">
                    <ul class="nav navbar-nav">
                        <li class="dropdown">
                          <a data-toggle="dropdown" class="dropdown-toggle" href="#">English <span class="caret"></span></a>
                            <ul role="menu" class="dropdown-menu">
                                <li><a href="#">German</a></li>
                                <li><a href="#">French</a></li>
                                <li><a href="#">Italian</a></li>
                                <li><a href="#">Spanish</a></li>
                            </ul>
                        </li>
                        <li><a href="#">Files</a></li>
                    </ul>
                </nav> -->
                <!-- Right navbar -->
                <ul class="list-inline navbar-right top-menu top-right-menu q_top_change">
                    <!-- mesages -->
                    <?php if($Info['ENTCode'] != 'E000000'){ ?>
                    <li class="dropdown">
                        <a href="/site/newscenter" >
                            <i class="fa fa-envelope-o " style="font-size: 18px;"></i>
                            <?php if($Info['NoReadMessageCount']) {?>
                                <span class="badge badge-sm up bg-primary count"><?php echo $Info['NoReadMessageCount']  ?></span>
                            <?php } ?>

                        </a>
                    </li>
                    <?php }?>
                    <!-- /messages -->
                    <!-- Notification -->
                    <li class="dropdown">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#" style="display: none;">
                            <i class="fa fa-bell-o"></i>
                            <span class="badge badge-sm up bg-pink count">3</span>
                        </a>
                        <ul class="dropdown-menu extended fadeInUp animated nicescroll" tabindex="5002">
                            <li class="noti-header">
                                <p>Notifications</p>
                            </li>
                            <li>
                                <a href="#">
                                    <span class="pull-left"><i class="fa fa-user-plus fa-2x text-info"></i></span>
                                    <span>New user registered<br><small class="text-muted">5 minutes ago</small></span>
                                </a>
                            </li>
                            <li>
                                <a href="#">
                                    <span class="pull-left"><i class="fa fa-diamond fa-2x text-primary"></i></span>
                                    <span>Use animate.css<br><small class="text-muted">5 minutes ago</small></span>
                                </a>
                            </li>
                            <li>
                                <a href="#">
                                    <span class="pull-left"><i class="fa fa-bell-o fa-2x text-danger"></i></span>
                                    <span>Send project demo files to client<br><small class="text-muted">1 hour ago</small></span>
                                </a>
                            </li>

                            <li>
                                <p><a href="#" class="text-right">See all notifications</a></p>
                            </li>
                        </ul>
                    </li>
                    <!-- /Notification -->
                    <!-- user login dropdown start-->
                    <li class="dropdown text-center">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <img alt="" src="<?php echo $Info['Photo'] ?>" onerror="this.src='/modules/img/slefneed/user_default.png'" class="img-circle profile-img thumb-sm">
                            <span class="username"><?php echo $Info['Nickname']? $Info['Nickname'] :'暂无昵称' ?></span> <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu extended pro-menu fadeInUp animated" tabindex="5003" style="overflow: hidden; outline: none;">
                            <li><a href="/userinfo/index"><i class="fa fa-cog"></i> 账号设置</a></li>
                            <?php if($Info['IsSuper']){ ?>
                                <li><a href="/site/company"><i class="ion-settings" style="margin-top: 0px;"></i>企业信息</a></li>
                            <?php } ?>

                            <li><a href="/login/index"><i class="fa fa-sign-out"></i>退出登录</a></li>
                        </ul>
                    </li>
                    <!-- user login dropdown end -->
                </ul>
                <!-- End right navbar -->
            </header>
            <!-- Header Ends -->
            <div class="wraper container-fluid">
                <?php $this->beginBody()  ?>
                    <?= $content ?>
                <?php $this->endBody() ?>
            </div>
            <!-- Footer Start -->
            <footer class="footer">
                2017 © 集客多多
            </footer>
            <!-- Footer Ends -->
        </section>
        <!-- js placed at the end of the document so the pages load faster -->
        <script src="/modules/js/bootstrap.min.js"></script>
        <script src="/modules/js/modernizr.min.js"></script>
        <script src="/modules/js/pace.min.js"></script>
        <script src="/modules/js/wow.min.js"></script>
        <script src="/modules/js/jquery.scrollTo.min.js"></script>
        <script src="/modules/js/jquery.nicescroll.js" type="text/javascript"></script>
        <script src="/modules/assets/chat/moment-2.2.1.js"></script>
        <script src="/modules/js/jquery.app.js"></script>
        <script src="/modules/js/jquery.todo.js"></script>

        <!-- 表格 -->
        <!-- <script src="/modules/assets/datatables/jquery.dataTables.min.js"></script> -->
        <!-- <script src="/modules/assets/datatables/dataTables.bootstrap.js"></script>  -->
    </body>
</html>
<script>

    $(document).on("click", ".input-group-addon", function(){

        $(this).prev().click();
        var idname = $(this).prev().attr('id');
        if(idname != 'example-input2-group2' && idname != 'example-input2-group1'){
            $('#'+idname).datetimepicker('show');
        }

    });
</script>
<?php $this->endPage() ?>
